<template>
  <view>save referrer ...</view>
</template>

<script>/**
 * h5 保存推荐人
 */
import User from '../../api/user'

const userModel = new User()

export default {
  onLoad(options) {
    const id = options.id
    if (!id) {
      uni.switchTab({
        url:'/pages/index/index'
      })
    } else {
      // 保存id
      console.log(id)
      userModel.setReferrer(id)

      // 跳转到注册
      uni.navigateTo({
        url: '/sub_common/user/register'
      })
    }
  }
}
</script>

<style scoped lang="scss">

</style>
